Skip to content

feat: per-host caching#1974

Merged
thomas-zahner merged 6 commits intolycheeverse:masterfrom
thomas-zahner:per-host-caching
Dec 30, 2025
Merged

feat: per-host caching#1974
thomas-zahner merged 6 commits intolycheeverse:masterfrom
thomas-zahner:per-host-caching

Conversation

@thomas-zahner
Copy link
Member

This actually implements per-host caching.
Previously there were some structures and methods which made it look like it was implemented. But upon closer inspection I realised this was not the case.

In the process I've also tried to clarify the difference between persistent inter-process caching (lychee cache file) and this process internal per-host caching in some places. Note that the requests which are cached in this "new" way do not appear as "cached" in the progress output. (from lychee cache [200] http://localhost:9000/ | OK (cached) vs per-host cached [200] http://localhost:9000/) I've considered doing that as well, but that would probably require quite an additional effort without really much UX improvement. The per-host statistics cache rate is accurate and does count the per-host cache hits as such.

Closes #1815 and #1593

This caching mechanism is independent of the lychee cache file.
Cache misses must only be tracked internally.
Previously cache misses were tracked twice.
@thomas-zahner thomas-zahner changed the title Per host caching feat: per-host caching Dec 29, 2025
Copy link
Member

@mre mre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the mess. That means that we kept checking repeated URLs to the same hosts. On the plus side, with this being merged, we should see another performance bump for websites with many identical links. Only added a few very minor syntactic suggestions. Semantically, it's all good, so feel free to ignore. Great work!

@thomas-zahner thomas-zahner merged commit 107716e into lycheeverse:master Dec 30, 2025
7 checks passed
@mre mre mentioned this pull request Dec 29, 2025
@thomas-zahner thomas-zahner self-assigned this Jan 3, 2026
@mre mre mentioned this pull request Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate links still checked

2 participants